package cn.txun.springboot41.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AxiosController {
    @RequestMapping("/helloAxios")
    public String helloAxios(String info){
        return "hello axios ,"+info;
    }
    @RequestMapping("/reg")
    public String reg(String username,String password){
        return "注册成功!"+username+","+password;
    }
    @RequestMapping("/check")
    public int check(String username){
        if(username.equals("tom")){
            return 2;//代表用户名已存在
        }
        return 1;//代表用户名可用
    }
}
